package com.gaogzhen.designPattern.producerConsumer.workSteal;

import com.gaogzhen.designPattern.producerConsumer.fullTextSearch.Channel;

import java.util.concurrent.BlockingDeque;

/**
 * @author Administrator
 * @version 1.0
 * @description 可窃取的通道
 * @date 2022-10-28 10:18
 */
public interface WorkStealingEnabledChannel<P> extends Channel<P> {
    /**
     * 从指定队列获取产品
     * @param preferredQueue    指定队列
     * @return                  产品
     * @throws InterruptedException 线程中断异常
     */
    P take(BlockingDeque<P> preferredQueue) throws InterruptedException;
}
